﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class PhieuTraSachBUS
    {
        #region 1. Them
        public static bool ThemPhieuTraSach(PhieuTraSachDTO pts){
            if (!DocGiaDAO.CheckDocGiaByID(pts.SoThe))
            {
                return false;
            }
            return PhieuTraSachDAO.ThemPhieuTraSach(pts);
        }
        #endregion
        #region 2. Sua
        public static bool SuaPhieuTraSach(PhieuTraSachDTO pts)
        {
            if (!DocGiaDAO.CheckDocGiaByID(pts.SoThe))
            {
                return false;
            }
            return PhieuTraSachDAO.SuaPhieuTraSach(pts);
        }
        #endregion
        #region 3. Xoa
        public static bool XoaPhieuTraSach(String mapts)
        {
            return PhieuTraSachDAO.XoaPhieuTraSach(mapts);
        }
        #endregion
        #region 4. Tim kiem
        public static PhieuTraSachDTO TimPTS(String mapts){
            return PhieuTraSachDAO.TimPTS(mapts);
        }
        public static DataTable TimTatCaPTS()
        {
            return PhieuTraSachDAO.TimTatCaPhieuTraSach();
        }
        #endregion
    }
}
